import 'package:flutter/material.dart';
import 'package:mall/constant/app_colors.dart';
import 'package:mall/modules/model/goods_detail_entity.dart';


class GoodsDetailIssueWidget extends StatelessWidget {
  const GoodsDetailIssueWidget({super.key, required this.model});

  final GoodsDetailEntity model;

  @override
  Widget build(BuildContext context) {
    final list = model.issue ?? [];
     return ListView.builder(
        padding: EdgeInsets.only(left: 20, right: 20),
        physics: NeverScrollableScrollPhysics(),
        shrinkWrap: true,
        itemCount: list.length,
        itemBuilder: (BuildContext context, int index) {
          return _issueItemView(list[index]);
        });
  }

  Widget _issueItemView(GoodsDetailIssue issue) {
    return Container(
        margin: EdgeInsets.only(bottom: 5),
        // padding: EdgeInsets.all(5),
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Text(issue.question ?? "", style: TextStyle(fontSize: 13, color: AppColors.C_333333)),
            // SizedBox(height: 5),
            Container(
                alignment: Alignment.centerLeft,
                child: Text(issue.answer ?? "", style: TextStyle(fontSize: 12, color: AppColors.C_999999))),
          ],
        ));
  }
}